home *** CD-ROM | disk | FTP | other *** search
- Path: sn.no!usenet
- From: Componen@sn.no (Dag Stσle Bakken)
- Newsgroups: comp.lang.c++
- Subject: Re: Urgent! Need help in Boralnd C++ 3.1
- Date: Thu, 04 Jan 1996 10:48:49 GMT
- Organization: Component-74 Eidsvold AS
- Message-ID: <4cg7au$o3j@hasle.sn.no>
- References: <30EC0650.185B@cuhk.hk>
- Reply-To: Componen@sn.no
- NNTP-Posting-Host: fp5-ppp13.oslo.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Eric Wong <b721742@cuhk.hk> wrote:
-
- >Help! How can I add the double click event in my application which is
- >written by Borland C++ 3.1!
-
- The example below will execute the function "FunctionName" when the
- application receives a message concerning the control with ID number
- 402. The function "FunctionName" will check if the message is a
- double-click from a ListBox. If 'TRUE', execute function
- "AnotherFunction" to do some action of your choice. (Perhaps load or
- save a file ?)
-
- class MyClass : public TDialog //'TDialog' or 'TWindow' or whatever
- {
- public:
-
- /* Some definitions */
-
- virtual void AnotherFunction();
- virtual void FunctionName(RTMessage Msg) = [ID_FIRST + 402]
- { if (Msg.LP.Hi!=LBN_DBLCLK) return;
- AnotherFunction(); };
-
- /* More definitions */
-
- };
-
- void MyClass::AnotherFunction()
- {
- // Do something
- }
-
- If you want this example to respond to one of the 'WM_XXXX' messages
- below, the function dispatch number [ID_FIRST + 402] must be exchanged
- with [WM_FIRST + {message}]. {message} is one of the 'WM' messages
- below.
-
-
- This example may be optimized in a big way, but in this form it's
- quite understandable (I hope).
-
-
- BN_DOUBLECLICKED Indicates the user double-clicked a button
- CBN_DBLCLK Indicates the user double-clicked a string in
- a ComboBox.
- LBN_DBLCLK Indicates that the user double-clicked a string
- in a ListBox.
-
- WM_COMMAND Specifies a command message
- WM_LBUTTONDBLCLK Indicates double-click of left mouse button
- WM_LBUTTONDOWN Indicates when left mouse button is pressed
- WM_LBUTTONUP Indicates when left mouse button is released
- WM_MBUTTONDBLCLK Indicates double-click of middle mouse button
- WM_MBUTTONDOWN Indicates when middle mouse button is pressed
- WM_MBUTTONUP Indicates when middle mouse button is released
- WM_NCLBUTTONDBLCLK Indicates non-client left button double-click
- WM_NCLBUTTONDOWN Indicates left button pressed in nonclient area
- WM_NCLBUTTONUP Indicates left button released in nonclient area
- WM_NCMBUTTONDBLCLK Indicates middle button nonclient double-click
- WM_NCMBUTTONDOWN Indicates middle button pressed in nonclient area
- WM_NCMBUTTONUP Indicates middle button released in nonclient area
- WM_NCRBUTTONDBLCLK Indicates right button nonclient double-click
- WM_NCRBUTTONDOWN Indicates right button pressed in nonclient area
- WM_NCRBUTTONUP Indicates right button released in nonclient area
- WM_RBUTTONDBLCLK Indicates a double-click of right mouse button
- WM_RBUTTONDOWN Indicates when the right mouse button is pressed
- WM_RBUTTONUP Indicates when the right mouse button is released
-
-
-